﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using LabHelper.forms;
using WeifenLuo.WinFormsUI.Docking;

namespace LabHelper
{
    public partial class MianForm : Form
    {
        public MianForm()
        {
            InitializeComponent();
        }

        private void MianForm_Load(object sender, EventArgs e)
        {
            createForm(schoolTeam.FormName);
            createForm(chipsInfo.FormName);
            createForm(labAssets.FormName);
            createForm(Explorer.FormName);
        }

        public Form createForm(String name)
        {
            DockContent form = null;
            if(name.Equals(schoolTeam.FormName))
            {
                form = new schoolTeam();
            }
            else if (name.Equals(labAssets.FormName))
            {
                form = new labAssets();
            }
            else if (name.Equals(chipsInfo.FormName))
            {
                form = new chipsInfo();
            }
            else if (name.Equals(Explorer.FormName))
            {
                form = new Explorer();
            }
            if(form != null)
            {
                form.Show(this.dockPanel);
                form.DockTo(this.dockPanel, DockStyle.None);
            }
            
            return form;
        }

        private void MianForm_FormClosing(object sender, FormClosingEventArgs e)
        {

        }
    }
}
